<template>
    <div class="view_con" v-if="art&&art.belong==type">
        <div class="view_title">
            {{art&&art.title}}
        </div>
        <div class="text_container" v-html="art&&art.content">

        </div>
    </div>
    <el-empty v-else></el-empty>
</template>

<script>
export default {
    name: 'View',

    data() {
        return {
            art:null,
            type:1
        };
    },

    mounted() {
        this.getdata()
    },
    watch:{
        $route:{
            handler(newval,oldval){
                this.type = newval.query.type
                this.getdata()
            },
            deep:true,
            immediate:true
        }
    },
    methods: {
        getdata(){
            this.$api.post('getArticleList',{
                "searchKey":"",
                    "sort":"sort",
                    limit:20,
                    "type":'工作室概况'
            }).then(res=>{
                res.data.list.forEach(item => {
                    if(item.belong == this.type){
                        this.art = item
                    }
                });
            })
        }
    },
};
</script>

<style lang="scss" scoped>
   @import  '@/assets/css/common.scss';
</style>